<html>

<head>
	<meta charset="UTF-8">
	<!-- import CSS -->
	<!-- <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css"> -->
	<link rel="stylesheet" href="css/element.css" />
	<link rel="stylesheet" href="css/style.css" />
	<link rel="stylesheet" href="css/swipImg.css">
	<link rel="stylesheet" href="css/editormd.css" />
	<link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" />

	<!-- 先引入 Vue -->
	<script src="js/vue.js"></script>
	<!-- 引入组件库 -->
	<script src="js/element.ui.js"></script>
	<script src="js/jquery.min.js"></script>
	<script src="lib/jquery.cookie.js"></script>
	<script src="js/smtp.js"></script>
	<script src="js/swipImg.js"></script>
	<script src="editormd.js"></script>
	<script src="https://cdn.jsdelivr.net/npm/leancloud-storage@3.14.1/dist/av-live-query-min.js"></script>
	<script src="lib/c.js"></script>
	<script src="js/a.js"></script>
	<script src="lib/core.js" type="text/javascript"></script>
	<script src="lib/vue-marked.js" type="text/javascript"></script>
	<script src="js/crypto-js.js"></script>

</head>

<body>

	<div id="test-editormd" ">
			<textarea  style=" display:none;"></textarea>
	</div>
	<div id="app">

		<!-- ----------------------表格------------------ -->

		<el-dialog title="查看公开的服务器文章" :visible.sync="customerBean.dialogVisible">
			<template>

				<div class="flex">
					<el-button type="primary" size="medium" icon="el-icon-search"
						@click="customerBean.queryData.action.searchAction()">
						搜索</el-button>
					</el-input>
					<el-input v-model="customerBean.queryData.nameinput"
						@keyup.enter.native="customerBean.queryData.action.searchAction" placeholder="文章识别码"
						style="flex:1;margin-right: 10px;"></el-input>
				</div>


				<div class="space"></div>

				<el-table v-loading="dialogloading" :data="customerBean.queryData.list" border>
					<el-table-column property="name" label="文章名"></el-table-column>
					<el-table-column property="UserId" label="识别码"></el-table-column>
					<el-table-column property="timeString" label="修改日期"></el-table-column>
					<el-table-column label="操作" width="120">
						<template slot-scope="scope">
							<el-button @click="overWatchItem(scope.row)" type="text">预览</el-button>
							<el-button @click="editMd(scope.row)" type="text" size="small">编辑查看</el-button>
						</template>
					</el-table-column>
				</el-table>
				<div class="space"></div>
				<el-pagination background layout="prev, pager, next" :page-count="customerBean.queryData.totlePage"
					@current-change="customerBean.queryData.action.executePageChange">
				</el-pagination>
			</template>
		</el-dialog>

		<!-- ----------------------表格------------------ -->


		<!-- ----------------------------------管理超级管理员-------------------------- -->
		<el-dialog title="超级用户管理" width="80%" :close-on-click-modal="false" :visible.sync="userBean.dialogVisible"
			:center="true">
			<template>
				<el-container style=" border: 1px solid #eee">
					<el-aside id="menuSide" width="200px" style="background-color: rgb(238, 241, 246)">
						<el-menu :default-openeds="userBean.defultOpeneds"
							:default-active="userBean.activeWindow.MenuActive" @select="MenueSelect">
							<el-submenu index="0">
								<template slot="title"><i class="el-icon-s-order"></i>我的文章</template>

								<el-menu-item v-for="(menuItem,itemIndex) in userBean.leftMenuBean.owerFileTags"
									:key="itemIndex" :index=('0-'+itemIndex)>
									<template><i class="el-icon-s-finance"></i>{{menuItem.name}}</template>

								</el-menu-item>
							</el-submenu>
							<el-menu-item index="1-099">
								<template><i class="el-icon-s-management"></i>服务器公开文章</template>
							</el-menu-item>
							<el-submenu index="1">
								<template slot="title"><i class="el-icon-menu"></i>我的群组</template>

								<label v-for="(menuItem,itemIndex) in userBean.leftMenuBean.myGroups" :key="itemIndex">
									<el-submenu :index=('1-'+itemIndex)>
										<template slot="title"><i
												class="el-icon-s-custom"></i>{{menuItem.groupName}}</template>
										<el-menu-item :index=getIndex('1-',itemIndex,'-0')>
											<template><i class="el-icon-s-check"></i>管理群组人员</template>
										</el-menu-item>
										<el-menu-item :index=getIndex('1-',itemIndex,'-1')>
											<template><i class="el-icon-s-management"></i>管理群组文章</template>
										</el-menu-item>
									</el-submenu>
								</label>
								<el-menu-item index="1-200">
									<template><i class="el-icon-circle-plus"></i>加入群组</template>
								</el-menu-item>
								<el-menu-item index="1-100">
									<template><i class="el-icon-circle-plus"></i>新建群组</template>
								</el-menu-item>

							</el-submenu>
							<template v-if="userBean.isMaster">
								<el-submenu index="100">
									<template slot="title"><i class="el-icon-s-management"></i>站长管理</template>

									<el-menu-item index="3-1">
										<template><i class="el-icon-s-management"></i>管理所有成员</template>
									</el-menu-item>
									<el-menu-item index="3-2">
										<template><i class="el-icon-s-management"></i>管理所有群组</template>
									</el-menu-item>
									<el-menu-item index="3-3">
										<template><i class="el-icon-s-management"></i>管理所有文章</template>
									</el-menu-item>
								</el-submenu>
							</template>
						</el-menu>

						</el-input>
					</el-aside>

					<el-container>
						<el-header style="text-align: right; font-size: 12px">
							<el-dropdown>
								<span id="loginTag">{{userBean.loginName }}</span>
								<span id="loginTag">{{userBean.powerLab}}</span>
								<el-dropdown-menu slot="dropdown">

									<el-dropdown-item @click.native="loginOut">注销</el-dropdown-item>
									<el-dropdown-item @click.native="changePwd()">修改密码</el-dropdown-item>
									<el-dropdown-item @click.native="cleanCatch()">刷新(清除缓存)</el-dropdown-item>
									<el-dropdown-item>查看详情</el-dropdown-item>
								</el-dropdown-menu>
							</el-dropdown>

						</el-header>

						<el-main>
							<el-tabs v-if="userBean.editableTabs.length>0" v-model="userBean.editableTabsValue"
								type="border-card" closable @tab-remove="removeTab" @tab-click="tabClick">
								<el-tab-pane v-for="(item, index) in userBean.editableTabs" :key="item.name"
									:label="item.title" :name="item.name">
									<template>
										<template v-if="userBean.activeWindow.type===0||userBean.activeWindow.type===1">
											<div class="flex">
												<el-button type="primary" size="medium" icon="el-icon-search"
													@click="userBean.activeWindow.TableBean.action.searchAction()">
													搜索</el-button>
												</el-input>
												<el-input v-model="userBean.activeWindow.TableBean.nameinput"
													@keyup.enter.native="userBean.activeWindow.TableBean.action.searchAction()"
													placeholder="文章名" style="flex:1;margin-right: 10px;"></el-input>
											</div>
											<div class="space"></div>

											<div class="flex">


												<el-button v-if="userBean.activeWindow.type===0" size="small"
													type="primary" plain
													@click="addMdPost(userBean.activeWindow.TableBean)">新增文章
												</el-button>
												<el-button v-else size="small" type="primary" plain
													@click="newGroupMd(userBean.activeWindow.TableBean)">新建组文章
												</el-button>
											</div>

											<el-table :header-cell-style="{color:'balck'}" v-loading="dialogloading"
												:data="userBean.activeWindow.TableBean.list" border>
												<el-table-column label="文章名">

													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.name">

															</el-input>
														</span>
														<span v-else>{{scope.row.name}}</span>
													</template>
												</el-table-column>

												<el-table-column label="所属群组">

													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-select size="mini" filterable remote
																:remote-method="userBean.remoteGroup"
																v-model="userBean.activeWindow.TableBean.seletItem.groupId"
																placeholder="请选择">
																<el-option v-for="item in userBean.allGroups"
																	:key="item.objectId" :label="item.groupName"
																	:value="item.groupId">
																</el-option>
															</el-select>
														</span>
														<span v-else>{{scope.row.groupName}}</span>
													</template>
												</el-table-column>

												<el-table-column label="作者">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.UserId">

															</el-input>
														</span>
														<span v-else>{{scope.row.UserId}}</span>
													</template>

												</el-table-column>
												<el-table-column label="标签" width="200px">
													<template slot-scope="scope">

														<el-tag size="small" v-for="tag in scope.row.tags"
															:key="tag.name" :closable="scope.row.isSet"
															@click="if(scope.row.isSet) userBean.activeWindow.TableBean.action.selectTagType(tag)"
															:type="tag.type"
															@close="userBean.activeWindow.TableBean.action.removeTag(scope.row.tags,tag)">
															{{tag.name}}
														</el-tag>
														<template v-if="scope.row.isSet">
															<el-button class="button-new-tag" size="mini"
																icon="el-icon-edit"
																@click="inputTagType(scope.row.tags)"></el-button>
														</template>

													</template>

												</el-table-column>

												<el-table-column label="权限">

													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-select size="mini" filterable
																v-model="userBean.activeWindow.TableBean.seletItem.power"
																placeholder="请选择">
																<el-option
																	v-for="item in userBean.powerList.md.powerLab"
																	:key="item.value" :label="item.name"
																	:value="item.value">
																</el-option>
															</el-select>
														</span>
														<span v-else>{{showMdPowerName(scope.row.power)}}</span>
													</template>
												</el-table-column>

												<el-table-column label="识别码">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.Identification">

															</el-input>
														</span>
														<span v-else>{{scope.row.Identification}}</span>
													</template>
												</el-table-column>
												<el-table-column property="timeString" width="150px" label="创建日期">
												</el-table-column>
												<el-table-column label="文章" width="150px">
													<template slot-scope="scope">
														<el-button v-if="scope.row.isSet" type="text"
															@click="importLocalMd(scope.row,userBean.activeWindow.TableBean.seletItem)">
															导入本地MD文章
														</el-button>
														<el-button v-else type="text"
															@click="insertMdEditor(scope.row)">导出到编辑器
														</el-button>
													</template>
												</el-table-column>
												<el-table-column label="操作" width="150px">
													<template slot-scope="scope">

														<el-button
															@click="overWatchItem(scope.row.isSet?userBean.activeWindow.TableBean.seletItem:scope.row)"
															type="text">预览
														</el-button>

														<el-button type="text"
															:disabled=userBean.activeWindow.disabledWrite
															@click="userBean.activeWindow.TableBean.action.saveChange(scope.row)">
															{{scope.row.isSet?'保存':"修改"}}
														</el-button>
														<el-button v-if="scope.row.isSet" type="text"
															@click="userBean.cancelEdit(scope.row)">取消</el-button>

														<el-button v-else type="text"
															:disabled=userBean.activeWindow.disabledWrite
															style="color: red" @click="delect(scope)">删除</el-button>
													</template>
												</el-table-column>
											</el-table>
											<div class="space"></div>
											<el-pagination background layout="prev, pager, next"
												:page-count="userBean.activeWindow.TableBean.totlePage"
												:current-page="userBean.activeWindow.TableBean.currentPage"
												@current-change="userBean.activeWindow.TableBean.action.executePageChange">
											</el-pagination>
										</template>

										<!-- 所有成员------------------------------------------------- -->
										<template v-else-if="userBean.activeWindow.type===3">
											<div class="flex">
												<el-button type="primary" size="medium" icon="el-icon-search"
													@click="userBean.activeWindow.TableBean.action.searchAction()">
													搜索</el-button>
												</el-input>
												<el-input v-model="userBean.activeWindow.TableBean.nameinput"
													@keyup.enter.native="userBean.activeWindow.TableBean.action.searchAction()"
													placeholder="管理员名称" style="flex:1;margin-right: 10px;"></el-input>
											</div>
											<div class="space"></div>
											<div class="flex">
												<el-button size="small" type="primary" plain
													@click="userBean.activeWindow.TableBean.action.addItem(userBean.activeWindow.TableBean)">
													添加超级管理员
												</el-button>
											</div>

											<el-table v-loading="dialogloading"
												:data="userBean.activeWindow.TableBean.list" border>
												<el-table-column label="管理员名称">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.name">
															</el-input>
														</span>
														<span v-else>{{scope.row.name}}</span>
													</template>
												</el-table-column>
												<el-table-column property="objectId" label="成员id"></el-table-column>

												<el-table-column label="权限等级">
													<template slot-scope="scope">


														<span v-if="scope.row.isSet">
															<el-select size="mini" filterable
																v-model="userBean.activeWindow.TableBean.seletItem.power"
																placeholder="请选择">
																<el-option
																	v-for="item in userBean.powerList.number.powerLab"
																	:key="item.value" :label="item.name"
																	:value="item.value">
																</el-option>
															</el-select>
														</span>
														<span v-else>{{showNumberPowerName(scope.row.power)}}</span>
													</template>
												</el-table-column>


												<el-table-column prop="tag" label="审核状态"
													:filters="[{ text: '通过', value: '通过' }, { text: '未通过', value: '未通过' }, { text: '待审核', value: '待审核' }]"
													:filter-method="filterTag" filter-placement="bottom-end">
													<template slot-scope="scope">
														<el-tag
															:type="scope.row.examine == '通过' ? 'success' : 'primary'"
															close-transition>{{scope.row.examine}}</el-tag>
													</template>
												</el-table-column>


												<el-table-column label="密码">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<!-- <el-input size="mini" placeholder="请输入内容" v-model="userBean.activeWindow.TableBean.seletItem.pwd">
																</el-input> -->
															<el-button type="text" size="small" style="color: red"
																@click="userBean.activeWindow.TableBean.seletItem.pwd='123456'">
																重置密码</el-button>
														</span>
														<span v-else>******</span>
													</template>
												</el-table-column>

												<el-table-column label="邮箱">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.mail">
															</el-input>
														</span>
														<span v-else>{{scope.row.mail}}</span>
													</template>
												</el-table-column>
												<!-- mail -->
												<el-table-column property="timeString" label="创建日期"></el-table-column>
												<el-table-column label="操作" width="120">
													<template slot-scope="scope">


														<el-button type="text" size="small"
															@click="userBean.activeWindow.TableBean.action.saveChange(scope.row)">
															{{scope.row.isSet?'保存':"编辑"}}</el-button>
														<el-button v-if="scope.row.isSet" type="text"
															@click="userBean.cancelEdit(scope.row)">取消</el-button>
														<el-button v-if="scope.row.examine != '通过'" type="text"
															size="small" style="color: red"
															@click="acceptUser(scope.row) ">审核通过</el-button>
														<el-button v-else type="text" size="small" style="color: red"
															@click="delect(scope)">移除成员</el-button>
													</template>
												</el-table-column>

											</el-table>
											<div class="space"></div>
											<el-pagination background layout="prev, pager, next"
												:page-count="userBean.activeWindow.TableBean.totlePage"
												@current-change="userBean.activeWindow.TableBean.action.executePageChange">
											</el-pagination>
										</template>
										<!-- ------------------------------------------------	 -->
										<!-- ------------------------管理当前群组人员------------------------	 -->
										<template v-else-if="userBean.activeWindow.type===2">
											<div class="flex">
												<el-button type="primary" size="medium" icon="el-icon-search"
													@click="userBean.activeWindow.TableBean.action.searchAction()">
													搜索</el-button>
												</el-input>
												<el-input v-model="userBean.activeWindow.TableBean.nameinput"
													@keyup.enter.native="userBean.activeWindow.TableBean.action.searchAction()"
													placeholder="群组成员名称" style="flex:1;margin-right: 10px;"></el-input>
											</div>
											<div class="space"></div>
											<div class="flex">
												<el-button size="small" type="primary" plain
													@click="userBean.activeWindow.TableBean.action.addItem(userBean.activeWindow.TableBean)">
													添加成员
												</el-button>
											</div>

											<el-table v-loading="dialogloading"
												:data="userBean.activeWindow.TableBean.list" border>


												<el-table-column label="所属群组">

													<template slot-scope="scope">
														<!-- <span v-if="scope.row.isSet">
															<el-select size="mini" filterable
																v-model="userBean.activeWindow.TableBean.seletItem.groupId"
																placeholder="请选择">
																<el-option v-for="item in userBean.allGroups"
																	:key="item.objectId" :label="item.groupName"
																	:value="item.groupId">
																</el-option>
															</el-select>
														</span> -->
														<span>{{scope.row.groupName}}</span>
													</template>
												</el-table-column>

												<el-table-column property="numberName" label="成员名称">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-select size="mini" filterable remote reserve-keyword
																:remote-method="userBean.remoteUser"
																:loading="userBean.remoteloading"
																@change="userBean.remoteChange"
																v-model="userBean.activeWindow.TableBean.seletItem.temp"
																placeholder="输入姓名检索">
																<el-option v-for="item in userBean.remoteList"
																	:key="item.objectId" :label="item.name"
																	:value="item.objectId">
																</el-option>
															</el-select>
														</span>
														<span v-else>{{scope.row.numberName}}</span>
													</template>
												</el-table-column>
												<el-table-column property="numberId" label="成员id">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															{{userBean.activeWindow.TableBean.seletItem.numberId}}
														</span>
														<span v-else>{{scope.row.numberId}}</span>
													</template>
												</el-table-column>
												<el-table-column property="power" label="权限等级">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.power">
															</el-input>
														</span>
														<span v-else>{{scope.row.power}}</span>
													</template>
												</el-table-column>
												<el-table-column property="timeString" label="创建日期"></el-table-column>
												<el-table-column label="操作" width="120">
													<template slot-scope="scope">


														<el-button type="text" size="small"
															@click="userBean.activeWindow.TableBean.action.saveChange(scope.row)">
															{{scope.row.isSet?'保存':"编辑"}}</el-button>
														<el-button v-if="scope.row.isSet" type="text"
															@click="userBean.cancelEdit(scope.row)">取消</el-button>
														<el-button v-else type="text" size="small" style="color: red"
															@click="delect(scope)">移除成员</el-button>
													</template>

												</el-table-column>

											</el-table>
											<div class="space"></div>
											<el-pagination background layout="prev, pager, next"
												:page-count="userBean.activeWindow.TableBean.totlePage"
												@current-change="userBean.activeWindow.TableBean.action.executePageChange">
											</el-pagination>
										</template>
										<!-- ----------------默认表格----------------------- -->
										<template v-else>
											<div class="flex">
												<el-button type="primary" size="medium" icon="el-icon-search"
													@click="userBean.activeWindow.TableBean.action.searchAction()">
													搜索</el-button>
												</el-input>
												<el-input v-model="userBean.activeWindow.TableBean.nameinput"
													@keyup.enter.native="userBean.activeWindow.TableBean.action.searchAction()"
													placeholder="关键字" style="flex:1;margin-right: 10px;"></el-input>
											</div>
											<div class="space"></div>
											<div class="flex">
												<el-button size="small" type="primary" plain
													@click="userBean.activeWindow.TableBean.action.addItem(userBean.activeWindow.TableBean)">
													添加
												</el-button>
											</div>

											<el-table v-loading="dialogloading"
												:data="userBean.activeWindow.TableBean.list" border>

												<el-table-column property="name" label="名称">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.name">
															</el-input>
														</span>
														<span v-else>{{scope.row.name}}</span>
													</template>
												</el-table-column>
												<el-table-column property="objectId" label="id">
													<template slot-scope="scope">
														<span v-if="scope.row.isSet">
															<el-input size="mini" placeholder="请输入内容"
																v-model="userBean.activeWindow.TableBean.seletItem.objectId">
															</el-input>
														</span>
														<span v-else>{{scope.row.objectId}}</span>
													</template>
												</el-table-column>
												<el-table-column property="timeString" label="创建日期"></el-table-column>
												<el-table-column label="操作" width="230">
													<template slot-scope="scope">
														<el-button type="text" size="small"
															@click="AllGroupMdManager(scope.row)">组内文章</el-button>
														<el-button type="text" size="small"
															@click="AllGroupNumberManager(scope.row)">组内成员</el-button>
														<!-- 管理组内成员 -->
														<el-button type="text" size="small"
															@click="userBean.activeWindow.TableBean.action.saveChange(scope.row)">
															{{scope.row.isSet?'保存':"编辑"}}</el-button>
														<el-button v-if="scope.row.isSet" type="text"
															@click="userBean.cancelEdit(scope.row)">取消</el-button>
														<el-button v-else type="text" style="color: red" size="small"
															@click="delect(scope)">删除</el-button>
													</template>

												</el-table-column>

											</el-table>
											<div class="space"></div>
											<el-pagination background layout="prev, pager, next"
												:page-count="userBean.activeWindow.TableBean.totlePage"
												@current-change="userBean.activeWindow.TableBean.action.executePageChange">
											</el-pagination>
										</template>
									</template>
								</el-tab-pane>
							</el-tabs>
							<template v-else>
								<div style="width: 100%;text-align: center">
									<el-image
										:src="'https://img.vim-cn.com/75/ea527915848842f5efe59ad32518e3cfbd7953.gif'">
									</el-image>
									<br />
									<span style="font-size: 20px">没有数据啊</span>
								</div>

							</template>
						</el-main>
					</el-container>
				</el-container>
			</template>
		</el-dialog>
		<!-- -------------------------预览浮窗--------------------------------- -->

		<el-dialog title="在线预览" :visible.sync="mdOverWatchEnable">
			<template>
			<div id="overMd" style="padding:10px">
			</div>
			<div style="display: flex;justify-content: flex-end;">
			<el-button type="text" @click="shareMd" icon="el-icon-share">分享这篇文章并生成链接</el-button>
			</div>
		</template>
		</el-dialog>
		<!-- ------------------------预览浮窗--------------------------------- -->

		<!-- -------------------------修改密码--------------------------------- -->

		<el-dialog title="修改密码" :visible.sync="Form.changePwdForm.dialogVisible" width="500px" :center="true">
			<template>
				<el-form :model="Form.changePwdForm.bean" status-icon :rules="Form.changePwdForm.rules"
					:ref="Form.changePwdForm.ref" label-width="100px" class="demo-pwdForm">
					<el-form-item label="旧密码" prop="pass">
						<el-input type="password" v-model="Form.changePwdForm.bean.pass" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="新密码" prop="checkPass">
						<el-input type="password" v-model="Form.changePwdForm.bean.checkPass" autocomplete="off">
						</el-input>
					</el-form-item>
					<el-form-item label="滑动验证">
						<div id="slideImageWrap">
						</div>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="Form.changePwdForm.submitPwd()">提交</el-button>
						<el-button @click="Form.changePwdForm.resetPwd()">重置</el-button>
					</el-form-item>
				</el-form>
			</template>
		</el-dialog>
		<!-- ------------------------修改密码--------------------------------- -->
		<!-- -------------------------登录--------------------------------- -->

		<el-dialog title="超级管理员" :visible.sync="Form.loginForm.dialogVisible" width="500px" :center="true">
			<template v-if="Form.loginForm.mailVisble">
				<div>
					<el-form :model="Form.loginForm.registerBean" status-icon :rules="Form.loginForm.maileRules"
						:ref="Form.loginForm.maileRef" label-width="100px">
						<el-form-item label="账号" prop="name">
							<el-input type="text" placeholder="请输入账号" v-model="Form.loginForm.registerBean.name"
								autocomplete="off"></el-input>
						</el-form-item>
						<el-form-item label="邮箱" prop="mail">
							<el-input type="text" placeholder="请输入邮箱" v-model="Form.loginForm.registerBean.mail"
								autocomplete="off">
							</el-input>
						</el-form-item>
						<el-form-item label="滑动验证">
							<div id="slideImageWrap1">
							</div>
						</el-form-item>

						<el-form-item>
							<el-button type="primary" @click="Form.loginForm.registerUser">申请超级管理员</el-button>
							<el-button type="primary" @click="Form.loginForm.mailVisble=false">返回登录</el-button>
						</el-form-item>
					</el-form>
				</div>
			</template>
			<template v-else>
				<el-form :model="Form.loginForm.bean" status-icon :rules="Form.loginForm.rules"
					:ref="Form.loginForm.ref" label-width="100px">

					<el-form-item label="账号/邮箱" prop="name">
						<el-input type="text" v-model="Form.loginForm.bean.name" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="密码" prop="pwd">
						<el-input type="password" v-model="Form.loginForm.bean.pwd" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item>
						<el-button type="primary" @click="Form.loginForm.loginAdmin">登录</el-button>
						<el-button type="text" @click="Form.loginForm.register">申请超级管理员</el-button>
						<el-button type="text" @click="Form.loginForm.forgetPwd">忘记密码</el-button>
					</el-form-item>
				</el-form>
			</template>
		</el-dialog>
		<!-- ------------------------登录--------------------------------- -->

		<!-- -------------------------忘记密码--------------------------------- -->

		<el-dialog title="找回密码" :visible.sync="Form.forgetPwdForm.dialogVisible" width="500px" :center="true">
			<template>

				<el-form :model="Form.forgetPwdForm.bean" status-icon :rules="Form.forgetPwdForm.rules"
					:ref="Form.forgetPwdForm.ref" label-width="100px">
					<el-form-item label="账号" prop="name">
						<el-input type="text" v-model="Form.forgetPwdForm.bean.name" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="邮箱" prop="mail">
						<el-input type="text" v-model="Form.forgetPwdForm.bean.mail" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="滑动验证">
						<div id="slideImageWrap3">
						</div>
					</el-form-item>
					<el-form-item>
						<el-button type="primary">提交邮箱</el-button>
					</el-form-item>
				</el-form>

			</template>

		</el-dialog>
		<!-- ------------------------忘记密码--------------------------------- -->
		<!-- -------------------------新建群组--------------------------------- -->

		<el-dialog title="新建群组" :visible.sync="Form.creatGroupForm.dialogVisible" width="500px" :center="true">
			<template>

				<el-form status-icon :model="Form.creatGroupForm.bean" :rules="Form.creatGroupForm.rules"
					:ref="Form.creatGroupForm.ref">
					<el-form-item label="群组名称" prop="name">
						<el-input type="text" v-model="Form.creatGroupForm.bean.name" autocomplete="off"></el-input>
					</el-form-item>

					<el-form-item>
						<el-button type="primary" @click.native="Form.creatGroupForm.action">创建群组</el-button>
					</el-form-item>
				</el-form>

			</template>

		</el-dialog>
		<!-- ------------------------新建群组--------------------------------- -->

		<!-- -------------------------加入群组--------------------------------- -->

		<el-dialog title="加入群组" :visible.sync="Form.joinGroupForm.dialogVisible" width="500px" :center="true">
			<template>

				<el-form status-icon :model="Form.joinGroupForm.bean">
					<el-form-item label="群组">
						<el-select style="width: 100%; height: 39px;" size="mini" filterable remote
							:remote-method="userBean.remoteGroup" v-model="Form.joinGroupForm.bean.groupId"
							placeholder="请选择">
							<el-option v-for="item in userBean.allGroups" :key="item.objectId" :label="item.groupName"
								:value="item.groupId">
							</el-option>
						</el-select>
					</el-form-item>

					<el-form-item>
						<el-button type="primary" @click="Form.joinGroupForm.action">加入群组</el-button>
					</el-form-item>
				</el-form>

			</template>

		</el-dialog>
		<!-- ------------------------新建群组--------------------------------- -->

		<!-- -------------------------上传文章--------------------------------- -->

		<el-dialog title="上传文章到服务器" :visible.sync="Form.upLoadForm.dialogVisible" width="500px" :center="true">
			<template>

				<el-form status-icon>
					<el-form-item label="文章名称" prop="name">
						<el-input type="text" v-model="Form.upLoadForm.bean.name" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item label="文章作者">
						<el-input type="text" v-model="Form.upLoadForm.bean.UserId" autocomplete="off"></el-input>
					</el-form-item>
					<el-form-item v-if="Form.upLoadForm.open === '1' && !(Form.upLoadForm.isCustomer)" label="所属群组">
						<el-select style="width: 100%" v-model="Form.upLoadForm.bean.groupId" placeholder="请选择">
							<el-option v-for="item in userBean.allGroups" :key="item.objectId" :label="item.groupName"
								:value="item.groupId">
							</el-option>
						</el-select>
					</el-form-item>
					<el-form-item label="修改权限">
						<el-radio-group style="width: 100%" v-model="Form.upLoadForm.bean.power">
							<el-radio-button label="0">所有人</el-radio-button>
							<el-radio-button label="1">群组</el-radio-button>
							<el-radio-button label="2">创建者</el-radio-button>
						</el-radio-group>

					</el-form-item>

					<el-form-item label="是否对所有人公开">
						<el-radio-group style="margin-left: 15px" v-model="Form.upLoadForm.open">
							<el-radio-button label="0">是</el-radio-button>
							<el-radio-button label="1">否</el-radio-button>

						</el-radio-group>

					</el-form-item>
					<el-form-item>
						<el-button type="primary" :disabled=Form.upLoadForm.disabled
							@click="Form.upLoadForm.action.commit">提交到服务器</el-button>

					</el-form-item>
				</el-form>

			</template>

		</el-dialog>
		<!-- ------------------------上传文章--------------------------------- -->



		<!-- ----------------------留言板------------------ -->
		<el-dialog title="在线留言板" :visible.sync="dialogVisible" width="50%">
			<template>
				<iframe frameborder=0 src="chart.html" style="width:100%; height: 500px;"></iframe>
			</template>
		</el-dialog>
		<!-- ----------------------留言板------------------ -->


		<!-- ----------------------嵌入网页------------------ -->
		<el-dialog title="iframe" :visible.sync="iframeDialogVisible" width="70%">
			<template>
				<iframe frameborder=0 src="../2md/index.html" style="width:100%; height: 650px;"></iframe>
			</template>
		</el-dialog>
		<!-- ----------------------留言板------------------ -->
	</div>



	<img class="btn" width="50px" height="50px" src="images/message.png" onclick="chartBtn()" style="width: 50px; height: 50px;position: absolute;z-index: 999;bottom: 50px; right: 50px;
		 border-radius: 25px; border:1px solid dodgerblue;box-shadow: 5px 5px 5px #888888;">


</body>


<script>
	if(!IsPC()){
		window.location.replace("phone/index.html");
		let exception = new CommonException('检测到手机', 1);
        throw exception
	}
	
	var VueUI = new Vue({
		el: '#app',
		methods: {
			shareMd(){
				if(this.mdOverWatchData.objectId.isEmpty()){
					VueUI.$message.error("当前文章无法分享");
				}else{
					window.open("share/index.html?data="+getAES(this.mdOverWatchData.objectId)) 
				}
				
			},
			cleanCatch() {
				VueAction.cleanCatch()
			},
			showMdPowerName(power) {
				return VueData().userBean.powerList.md.powerLab[parseInt(power)].name
			},
			showNumberPowerName(power) {
				return VueData().userBean.powerList.number.powerLab[parseInt(power)].name
			},
			inputTagType(arr) {
				this.$prompt('请输入标签名称', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					inputPattern: /\S/,
					inputErrorMessage: '不能为空'
				}).then(({ value }) => {
					arr.push({
						name: value,
						type: ''
					})
				}).catch(() => {
					this.$message({
						type: 'info',
						message: '取消输入'
					});
				});
			},
			filterTag(value, row) {
				return row.examine === value;
			},
			AllGroupNumberManager(arg) {
				let tabName
				let fun;
				let mData = new tableData();
				mData.groupId = arg.objectId; //群组id
				mData.groupName = arg.name;
				tabName = '(' + arg.name + ')人员管理(站长)';
				fun = function (that) {
					VueData().userBean.activeWindow.type = 2
					if (that) {
						VueData().userBean.activeWindow.TableBean = that.tableData;
						VueData().userBean.activeWindow.MenuActive = that.id;

					}
				}
				//mData群组人员操作的一些属性
				mData.DbName = $.Encryption.CloudTable.groupNumber
				mData.whereBuilder = function (it) {
					it.DbHelper.equalTo('groupId', it.groupId)
					it.DbHelper.contains('numberName', it.nameinput)
					return it.DbHelper;
				}
				var tabItem = VueAction.addTab(tabName, fun, '10001', mData)
				tabItem.fun(tabItem)
			},
			AllGroupMdManager(arg) {
				let tabName
				let fun;
				let mData = new tableData();
				mData.groupId = arg.objectId; //群组id
				mData.groupName = arg.name;
				tabName = '(' + arg.name + ')文章管理(站长)';
				fun = function (that) {
					VueData().userBean.activeWindow.type = 1
					if (that) {
						VueData().userBean.activeWindow.TableBean = that.tableData;
						VueData().userBean.activeWindow.MenuActive = that.id;
					}
				}
				//mData群组文章操作的一些属性
				mData.DbName = $.Encryption.CloudTable.MdList

				mData.whereBuilder = function (it) {

					it.DbHelper.equalTo('groupId', it.groupId)
					it.DbHelper.contains('name', it.nameinput)
					return it.DbHelper;
				}
				var tabItem = VueAction.addTab(tabName, fun, '10000', mData)
				tabItem.fun(tabItem)
			},
			importLocalMd(bean, editBean) {
				$.MdManager.eventManager().opnelocalFile(function (result, name) {
					editBean.data = result;
					if (editBean.name) {
						editBean.name = name
					} else {
						Vue.set(editBean, 'name', name)
					}
					VueUI.$notify({
						title: '成功',
						message: '导入文章成功',
						type: 'success'
					});

				});
			},
			addMdPost(bean) {
				if (VueAction.isTablEditor(bean.list)) {
					VueUI.$message.error("当前列表有内容正在编辑");
					return
				}
				let itemValue = {
					isSet: true,
					timeString: new Date().Format("yyyy-MM-dd HH:mm"),
					UserId: $.Encryption.user.bean.name
				}
				bean.seletItem = itemValue
				bean.list.unshift(itemValue)
			},

			newGroupMd(bean) {
				if (VueAction.isTablEditor(bean.list)) {
					VueUI.$message.error("当前列表有内容正在编辑");
					return
				}
				let itemValue = {
					isSet: true,
					groupId: bean.groupId,
					groupName: bean.groupName,
					timeString: new Date().Format("yyyy-MM-dd HH:mm")
				}
				bean.seletItem = itemValue
				bean.list.unshift(itemValue)
			},
			getIndex(strat, index, end) {
				return strat + index + end;
			},

			MenueSelect(key, keyPath) {
				replaceCurrentTabData();

				let tabs = VueData().userBean.editableTabs;
				let tab
				for (let i = 0; i < tabs.length; i++) {
					tab = tabs[i];
					if (tab.id == key) {
						VueData().userBean.editableTabsValue = tab.name;
						tab.fun(tab);
						return true;
					}
				}
				let tabName = "列表"
				let fun;
				let mData = new tableData();
				if (key == '3-1') {
					//管理所有成员
					fun = function (that) {
						VueData().userBean.activeWindow.type = 3

						if (that) {
							VueData().userBean.activeWindow.TableBean = that.tableData;
							VueData().userBean.activeWindow.MenuActive = that.id;
						}
					}
					tabName = "管理所有成员"
					mData.DbName = $.Encryption.CloudTable.UserMaster
					mData.whereBuilder = function (it) {
						it.DbHelper.contains('name', it.nameinput)
						return it.DbHelper
					}
					// 
				} else if (key == '1-099') {
					fun = function (that) {
						VueData().userBean.activeWindow.type = 0
						if (that) {
							VueData().userBean.activeWindow.TableBean = that.tableData;
							VueData().userBean.activeWindow.MenuActive = that.id;
						}
					}
					mData.DbName = $.Encryption.CloudTable.MdList
					mData.whereBuilder = function (it) {
						it.DbHelper.equalTo('power', '2')
						it.DbHelper.contains('name', it.nameinput)
						return it.DbHelper
					}
					tabName = "公开文章"
				} else if (key == '3-3') {
					fun = function (that) {
						VueData().userBean.activeWindow.type = 0
						if (that) {
							VueData().userBean.activeWindow.TableBean = that.tableData;
							VueData().userBean.activeWindow.MenuActive = that.id;
						}
					}
					mData.DbName = $.Encryption.CloudTable.MdList
					mData.whereBuilder = function (it) {
						it.DbHelper.contains('name', it.nameinput)
						return it.DbHelper
					}
					tabName = "管理所有文章"
				} else if (key == '3-2') {

					fun = function (that) {
						VueData().userBean.activeWindow.type = 4
						if (that) {
							VueData().userBean.activeWindow.TableBean = that.tableData;
							VueData().userBean.activeWindow.MenuActive = that.id;
						}
					}
					mData.DbName = $.Encryption.CloudTable.groupTable
					mData.whereBuilder = function (it) {
						it.DbHelper.contains('name', it.nameinput)
						return it.DbHelper
					}
					tabName = "管理所有群组"

				} else if (key == '1-100') {
					VueData().Form.creatGroupForm.dialogVisible = true
					return
				} else if (key == '1-200') {
					VueData().Form.joinGroupForm.dialogVisible = true
					return
				} else if (keyPath[0] == '0') {
					fun = function (that) {
						VueData().userBean.activeWindow.type = 0
						if (that) {
							VueData().userBean.activeWindow.TableBean = that.tableData;
							VueData().userBean.activeWindow.MenuActive = that.id;
						}
					}
					//mData所有文章操作的一些属性
					if (key == '0-0') {
						mData.whereBuilder = function (it) {
							it.DbHelper.equalTo('UserId', $.Encryption.user.bean.name)
							it.DbHelper.contains('name', it.nameinput)
							return it.DbHelper
						}
					} else if (key == '0-1') {
						mData.whereBuilder = function (it) {
							it.DbHelper.equalTo('UserId', $.Encryption.user.bean.name)
							it.DbHelper.equalTo('power', '2')
							it.DbHelper.contains('name', it.nameinput)
							return it.DbHelper
						}
					} else if (key == '0-2') {
						mData.whereBuilder = function (it) {
							it.DbHelper.equalTo('UserId', $.Encryption.user.bean.name)
							it.DbHelper.equalTo('power', '0')
							it.DbHelper.contains('name', it.nameinput)
							return it.DbHelper
						}
					}

					tabName = VueData().userBean.leftMenuBean.owerFileTags[parseInt(key.split('-').lastItem())].name;
				} else if (keyPath[0] == '1') {

					if (keyPath.length == 3) {
						VueData().userBean.defultOpeneds[2] = key; //防止菜单缩回
						let CurrentGroup = VueData().userBean.leftMenuBean.myGroups[parseInt(keyPath[1].split('-').lastItem())];
						mData.groupId = CurrentGroup.groupId; //群组id
						mData.groupName = CurrentGroup.groupName;
						if (key.endWith('0')) {
							tabName = '(' + CurrentGroup.groupName + ')人员管理';
							fun = function (that) {
								VueData().userBean.activeWindow.type = 2
								if (that) {
									VueData().userBean.activeWindow.TableBean = that.tableData;
									VueData().userBean.activeWindow.MenuActive = that.id;

								}
							}
							//mData群组人员操作的一些属性
							mData.DbName = $.Encryption.CloudTable.groupNumber
							mData.whereBuilder = function (it) {
								it.DbHelper.equalTo('groupId', it.groupId)
								it.DbHelper.contains('numberName', it.nameinput)
								return it.DbHelper;
							}
						} else {
							tabName = '(' + CurrentGroup.groupName + ')文章管理';
							fun = function (that) {
								VueData().userBean.activeWindow.type = 1
								if (that) {
									VueData().userBean.activeWindow.TableBean = that.tableData;
									VueData().userBean.activeWindow.MenuActive = that.id;
								}
							}
							//mData群组文章操作的一些属性
							mData.DbName = $.Encryption.CloudTable.MdList

							mData.whereBuilder = function (it) {

								it.DbHelper.equalTo('groupId', it.groupId)
								it.DbHelper.contains('name', it.nameinput)
								return it.DbHelper;
							}
						}
					}
				}
				var tabItem = VueAction.addTab(tabName, fun, key, mData)
				tabItem.fun(tabItem)
				console.log(key);
			},
			insertMdEditor(row) {
				VueData().userBean.dialogVisible = false;
				$.MdManager.loadeMarkDown(row);

			},
			loginOut() {
				$.Encryption.user.LoginOut();
				VueAction.cleanCatch()
				VueData().userBean.dialogVisible = false
				this.$message({
					type: 'success',
					message: '注销成功'
				});
			},

			changePwd() {
				VueData().Form.changePwdForm.dialogVisible = true
				VueAction.JsWithVue(function () {
					swipImg.init(document.getElementById('slideImageWrap'), function () {

					})
				})
			},
			acceptUser(row) {
				this.$confirm('审核通过并发送邮件，允许用户重置密码?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					row.examine = '通过'
					row.pwdChangeCode = uuid();
					$.MdManager.newSaveHelper(VueData().userBean.activeWindow.TableBean.DbName)
						.setObj(row).save(function (obj) {
							VueUI.$notify({
								title: '成功',
								message: '更新成功',
								type: 'success'
							});
							const loading = VueUI.$loading({
								lock: true,
								text: '正在发送邮件',
								spinner: 'el-icon-loading',
								background: 'rgba(0, 0, 0, 0.5)'
							});
							setTimeout(() => {
								loading.close();

								VueAction.sendMail(getEmailString(row.name, getAES(row.pwdChangeCode)), row.mail);
								VueUI.$notify({
									title: '提示',
									message: '发送邮件成功',
									type: 'success'
								});
							}, 2000);
						})
				}).catch(() => {

				});

			},
			delect(scope) {
				if (!$.Encryption.power.havePower(scope.row)) {
					VueUI.$message.error("没有权限");
					return
				}

				this.$confirm('此操作将永久删除, 是否继续?', '提示', {
					confirmButtonText: '确定',
					cancelButtonText: '取消',
					type: 'warning'
				}).then(() => {
					$.MdManager.newSaveHelper(VueData().userBean.activeWindow.TableBean.DbName).remove(scope.row);
					VueData().userBean.activeWindow.TableBean.list.remove(scope.row)
				}).catch((e) => {
					console.log(e)
					this.$message({
						type: 'info',
						message: '已取消删除'
					});
				});
			},
			nameString(time) {
				return $.MdManager.eventManager().getTime(time)
			},
			handleClose(done) {
				done();
			},
			Pagechange(index) {
				VueData().dialogloading = true;
				$.MdManager.eventManager().loadOPenList(null, index)
			},
			overWatchItem(row) {
				VueData().mdOverWatchEnable = true;
				VueAction.JsWithVue(function () {
					VueData().mdOverWatchData=row;
					$.MdManager.overWatchMd('overMd', row.data)
				})
			},
			editMd(row) {
				VueData().customerBean.dialogVisible = false;

				$.MdManager.loadeMarkDown(row);
			},
			removeTab(targetName) {
				let tabs = VueData().userBean.editableTabs;
				if (tabs.length == 1) {
					VueUI.$notify({
						title: '警告',
						message: '别关了留一个行不行☹',
						type: 'success'
					});
					return
				}
				let activeName = VueData().userBean.editableTabsValue;
				if (activeName === targetName) {
					replaceCurrentTabData();
					tabs.forEach((tab, index) => {
						if (tab.name === targetName) {
							let nextTab = tabs[index + 1] || tabs[index - 1];
							if (nextTab) {
								activeName = nextTab.name;
								nextTab.fun(nextTab)
							}
						}
					});
				}

				VueData().userBean.editableTabsValue = activeName;
				VueData().userBean.editableTabs = tabs.filter(tab => tab.name !== targetName);
			},
			tabClick(tab) {
				let tabs = VueData().userBean.editableTabs;
				let tabItem = tabs[tab.index];
				replaceCurrentTabData();
				tabItem.fun(tabItem);
			},
		},
		data: function () {
			return {

				iframeDialogVisible:false,
				pwdForm: {
					pass: '',
					checkPass: '',
				},


				nameinput: '',
				dialogVisible: false,
				enableChangePwd: false,
				customerBean: {
					dialogVisible: false,
					queryData: getCustomerTableData()
				},
				dialogloading: false,
				Form: {
					joinGroupForm: {
						dialogVisible: false,
						bean: {
							groupName: '',
							groupId: '',
							numberId: '',
							numberName: '',
						},
						action() {
							let bean = VueData().Form.joinGroupForm.bean;
							if (bean.groupId == '') {
								VueUI.$message.error("请选择群组");
								return
							}
							VueData().Form.joinGroupForm.dialogVisible = false;
							bean.numberId = $.Encryption.user.bean.objectId
							bean.numberName = $.Encryption.user.bean.name
							bean.groupName = VueAction.getGroupNameFromArr(VueData().userBean.allGroups, bean.groupId)
							$.MdManager.newSaveHelper($.Encryption.CloudTable.groupNumber).setObj(bean).save(function (result) {
								VueUI.$notify({
									title: '成功',
									message: '加入群组成功',
									type: 'success'
								});
							})
						}
					},
					creatGroupForm: {
						bean: {
							name: '',
						},
						rules: {
							name: [{
								required: true,
								message: '请填群组名称',
								trigger: 'blur'
							}],
						},
						action: function () {
							VueUI.$refs[VueData().Form.creatGroupForm.ref].validate((valid) => {
								if (valid) {
									$.MdManager.newSaveHelper($.Encryption.CloudTable.groupTable)
										.setObj(VueData().Form.creatGroupForm.bean).save(function (_obj) {
											let data = {
												groupId: _obj.id,
												groupName: VueData().Form.creatGroupForm.bean.name,
												numberName: $.Encryption.user.bean.name,
												numberId: $.Encryption.user.bean.objectId
											}
											var comment = new AV.Object($.Encryption.CloudTable.groupNumber);

											comment.save(data).then(function (result) {

												VueUI.$notify({
													title: '成功',
													message: '添加成功',
													type: 'success'
												});
												VueData().Form.creatGroupForm.dialogVisible = false;
												VueAction.loadGroup();
											})





										})
								} else {
									return false;
								}
							});
						},
						ref: 'Groupbean',
						dialogVisible: false,

					},
					upLoadForm: {
						dialogVisible: false,
						disabled: false,
						isCustomer: true,
						open: "1",
						bean: {
							power: "1",
						},
						action: {
							commit() {
								const loading = showLoading('正在提交.....')
								VueAction.commitEditorMd($.Encryption.getMdData(), function (arg) {
									loading.close()
									VueData().Form.upLoadForm.dialogVisible = false

								})
							}
						}
					},

					forgetPwdForm: {
						bean: {
							name: '',
							mail: null,
						},
						rules: {
							mail: [{
								required: true,
								message: '请输入邮箱地址',
								trigger: 'blur'
							},
							{
								type: 'email',
								message: '请输入正确的邮箱地址',
								trigger: 'blur,change'
							}
							],
							name: [{
								required: true,
								message: '请填写账号',
								trigger: 'blur'
							}],
						},
						ref: 'registerBean',
						dialogVisible: false,
					},
					changePwdForm: {
						resetPwd() {
							VueUI.$refs[VueData().Form.changePwdForm.ref].resetFields();
						},
						submitPwd: function () {
							VueUI.$refs[VueData().Form.changePwdForm.ref].validate((valid) => {
								if (valid) {
									console.log('submit!!==' + VueData().pwdForm.checkPass);
								} else {
									console.log('error submit!!==');
									return false;
								}
							});
						},
						ref: 'changePwdForm',
						bean: {
							pass: '',
							checkPass: '',
						},
						rules: {
							pass: [{
								required: true,
								message: '请填写旧密码',
								trigger: 'blur'
							}],
							checkPass: [{
								required: true,
								message: '请填写新密码',
								trigger: 'blur'
							}],
						},
						dialogVisible: false,
					},

					loginForm: {
						ref: 'loginForm',
						maileRef: 'registerBean',
						mailVisble: false,
						register: false,
						forgetPwd() {
							VueData().Form.loginForm.dialogVisible = false;
							VueData().Form.forgetPwdForm.dialogVisible = true;
							VueAction.JsWithVue(function () {
								swipImg.init(document.getElementById('slideImageWrap3'), function () {

								})
							})
						},
						register() {
							VueData().Form.loginForm.register = false;
							VueData().Form.loginForm.mailVisble = true;
							VueAction.JsWithVue(function () {
								swipImg.init(document.getElementById('slideImageWrap1'), function () {
									VueData().Form.loginForm.register = true;
								})
							})

						},
						registerUser() {
							if (VueData().Form.loginForm.register == false) {
								VueUI.$message.error("完成拼图验证");
								return
							}
							VueUI.$refs[VueData().Form.loginForm.maileRef].validate((valid) => {
								if (valid) {
									const loading = VueUI.$loading({
										lock: true,
										text: '正在登录......',
										spinner: 'el-icon-loading',
										background: 'rgba(0, 0, 0, 0.5)'
									});
									setTimeout(() => {
										var query = new AV.Query($.Encryption.CloudTable.UserMaster)
										query.equalTo('name',VueData().Form.loginForm.registerBean.name );
										query.count().then(function (count) {
											if (count == 0) {
												registerSuperUser(loading);
											} else {
												loading.close()
												VueUI.$message.error("账户名重复");
											}
										})


									}, 1000);

								} else {
									console.log('error submit!!==');
									return false;
								}
							});


						},
						loginAdmin() {
							VueUI.$refs[VueData().Form.loginForm.ref].validate((valid) => {
								if (valid) {
									const loading = showLoading('正在登陆.....')
									VueAction.login(VueData().Form.loginForm.bean.name, VueData().Form.loginForm.bean.pwd, function (flag, data) {
										loading.close();
										if (flag) {
											if (data.examine == '通过') {
												VueData().Form.loginForm.dialogVisible = false;
												$.MdManager.loginSucess(data)
												VueAction.loadGroup();
											} else {
												VueUI.$message.error("您的账号尚未审核通过");
											}

										} else {
											VueUI.$message.error("账户或密码错误");
										}
									})

								} else {

									return false;
								}
							});

						},
						registerBean: {
							name: '',
							mail: null,
						},
						bean: {
							name: '',
							pwd: '',
						},
						maileRules: {
							mail: [{
								required: true,
								message: '请输入邮箱地址',
								trigger: 'blur'
							},
							{
								required: true,
								type: 'email',
								message: '请输入正确的邮箱地址',
								trigger: 'blur'
							}
							],
							name: [{
								required: true,
								message: '请填写账号',
								trigger: 'blur'
							}],
						},

						rules: {
							name: [{
								required: true,
								message: '请填写账号',
								trigger: 'blur'
							}],
							pwd: [{
								required: true,
								message: '请填写新密码',
								trigger: 'blur'
							}],
						},
						dialogVisible: false,
					},

				},
				selectBean: {
					dialogVisible: false,

				},
				userBean: {
					dialogVisible: false,
					editableTabsValue: '1',
					remoteloading: false, //搜索选择器loading
					remoteList: [],
					powerList: {},
					isMaster: false,

					remoteChange(arg) {

						VueData().userBean.activeWindow.TableBean.seletItem.numberId = arg
						VueData().userBean.activeWindow.TableBean.seletItem.numberName = VueAction.GetUserName(VueData().userBean.remoteList,
							arg)
					},
					cancelEdit(row) {
						row.isSet = false
						if (!row.objectId) {
							VueData().userBean.activeWindow.TableBean.list.remove(row)
						}
					},
					remoteUser: function (query) {
						if (query !== '') {
							VueData().userBean.remoteloading = true;
							var helper = $.MdManager.newPageHelper($.Encryption.CloudTable.UserMaster)
							helper.contains('name', query)
							helper.getData(function (list) {
								VueData().userBean.remoteList = VueData().userBean.remoteList.concat(list);
								VueData().userBean.remoteloading = false;
							})
						}

					},
					remoteGroup: function (query) {
						if (query !== '') {
							VueData().userBean.remoteloading = true;
							var helper = $.MdManager.newPageHelper($.Encryption.CloudTable.groupTable)
							helper.contains('name', query)
							helper.getData(function (list) {
								VueData().userBean.remoteloading = false;
								VueData().userBean.allGroups = []
								list.forEach(function (value, index, arr1) {
									VueData().userBean.allGroups.push({
										groupId: value.objectId,
										groupName: value.name,
										objectId: value.objectId
									})
								})


							})
						}

					},
					editableTabs: [{
						title: '我的所有文章',
						name: '1',
						id: '0-0',
						tableData: getInitShowTableData(),
						fun: function (that) {
							VueData().userBean.activeWindow.type = 0
							if (that) {
								VueData().userBean.activeWindow.TableBean = that.tableData;
								VueData().userBean.activeWindow.MenuActive = that.id;
							}
						}
					}],
					defultOpeneds: ['0', '1'],
					tabIndex: 1,
					activeWindow: {
						type: 0, //0我的文章1我的群组文章2我的群组成员3服务器所有成员4服务器所有群组 
						MenuActive: '0-0',
						disabledWrite: false,
						TableBean: getInitShowTableData(), //显示表格数据的实现 所有表格数据到要给它赋值才能显示
					},

					loginName: '当前未登录',
					powerLab: '(会员)',
					allGroups: [],
					//  右侧菜单对象
					leftMenuBean: {
						myGroups: [], //我加入的群组
						owerFileTags: [{ //顶部二级菜单
							name: '我的所有文章',
							type: '0'
						}, {
							name: '我的公开文章',
							type: '1'
						}, {
							name: '我的私有文章',
							type: '2'
						}],
					},
				},
				//后面的我早晚要干掉你
				totlePage: 0,
				mdOverWatchEnable: false,
				mdOverWatchData:{},

			}
		},
		created: function () {
			$.MdManager.initMd();
			//$.MdManager.initMouse();
			$.MdManager.initCloud();

		}

	})

	function chartBtn() {
		VueData().dialogVisible = true;
	};

	function VueData() {
		return VueUI._data;
	}

	function getInitShowTableData() {
		let data = new tableData();
		data.whereBuilder = function (it) {
			it.DbHelper.equalTo('UserId', $.Encryption.user.bean.name)
			it.DbHelper.contains('name', it.nameinput)
			return it.DbHelper
		}

		return data
	}
	//获取访客文档数据
	function getCustomerTableData() {
		let data = new tableData();
		data.whereBuilder = function (it) {
			// it.DbHelper.equalTo('groupId', $.Encryption.CloudTable.MainCode.customer.groupId)//仅显示访客组
			it.DbHelper.equalTo('power', '2')
			it.DbHelper.contains('UserId', it.nameinput)
			return it.DbHelper
		}
		return data
	}
	//获取当前tab
	function getCurrentTabs() {
		let tabs = VueData().userBean.editableTabs;
		for (let i = 0; i < tabs.length; i++) {
			if (tabs[i].id == VueData().userBean.activeWindow.MenuActive) {
				return tabs[i]
			}
		}
		return null;
	}
	//替换当前到显示的数据到数组
	function replaceCurrentTabData() {
		if (VueData().userBean.editableTabs.length == 0) {
			return
		}
		let current = getCurrentTabs();
		if (current) {
			current.tableData = VueData().userBean.activeWindow.TableBean;
		} else {
			VueUI.$message.error("当前tab发生错误");
		}
	}
	//表格数据模型
	function tableData() {
		this.nameinput = '',
			this.list = [];
		this.seletItem = {};
		this.totlePage = 0;
		this.DbName = $.Encryption.CloudTable.MdList;
		this.DbHelper;
		this.groupId = ''
		this.currentPage = 1;
		this.tagType = ['', 'success', 'info', 'warning', 'danger']
		this.whereBuilder = function (Helper) {
			return Helper;
		}
		this.tagTypeIndex = 0;
		var that = this;
		this.action = {
			// 
			addItem: function (bean) {
				if (VueAction.isTablEditor(bean.list)) {
					VueUI.$message.error("当前列表有内容正在编辑");
					return
				}
				let itemValue = {
					isSet: true,
					groupId: bean.groupId,
					groupName: bean.groupName,
					timeString: new Date().Format("yyyy-MM-dd HH:mm")
				}
				bean.seletItem = itemValue
				bean.list.unshift(itemValue)
			},
			removeTag(array, tag) {
				array.remove(tag)
			},
			selectTagType(tag) {
				tag.type = that.tagType[(++that.tagTypeIndex) % (that.tagType.length)];
			},
			addTag(array) {

			},
			saveChange: function (row) {
				//提交数据
				if (row.isSet) {
					let seletItem = VueData().userBean.activeWindow.TableBean.seletItem;
					let objId = seletItem.objectId;
					if (seletItem.groupId)
						seletItem.groupName = VueAction.getGroupNameFromArr(VueData().userBean.allGroups, seletItem.groupId)
					row.isSet = false
					if (!objId) {
						$.MdManager.newSaveHelper(VueData().userBean.activeWindow.TableBean.DbName)
							.setObj(seletItem).save(function (_obj) {
								Vue.set(row, 'objectId', _obj.id)
								VueUI.$notify({
									title: '成功',
									message: '添加成功',
									type: 'success'
								});
							})
					} else {

						$.MdManager.newSaveHelper(VueData().userBean.activeWindow.TableBean.DbName)
							.setObj(seletItem).save(function (obj) {
								VueUI.$notify({
									title: '成功',
									message: '更新成功',
									type: 'success'
								});
							})

					}
				} else {
					if (!$.Encryption.power.havePower(row)) {
						VueUI.$message.error("没有权限");
						return
					}
					if (VueAction.isTablEditor(VueData().userBean.activeWindow.TableBean.list)) {
						VueUI.$message.error("当前列表有内容正在编辑");
						return
					}
					VueData().userBean.activeWindow.TableBean.seletItem = row
					row.isSet = true;
				}
			},
			searchAction: function () {
				VueData().dialogloading = true;
				that.DbHelper = $.MdManager.newPageHelper(that.DbName);
				that.whereBuilder(that);
				that.DbHelper.current = 1;
				that.DbHelper.getData(function (result) {
					that.list = VueAction.getTransTimeStringArr(result);
					VueData().dialogloading = false;
				})
				that.DbHelper.count(function (result) {
					that.totlePage = result;
				})

			},
			executePageChange: function (index) {
				VueData().dialogloading = true;
				if (that.DbHelper == null) {
					that.DbHelper = $.MdManager.newPageHelper(that.DbName);
					that.whereBuilder(that);
				}
				that.DbHelper.current = index;
				that.DbHelper.getData(function (result) {
					that.list = VueAction.getTransTimeStringArr(result);
					VueData().dialogloading = false;
				})
				that.currentPage = index;
			},

		}
	}
	var VueAction = {
		commitEditorMd(bean, callback) {
			$.MdManager.newSaveHelper($.Encryption.CloudTable.MdList).setObj(bean).save(function (result) {
				VueUI.$notify({
					title: '成功',
					message: '保存文章成功',
					type: 'success'
				});
				if (callback) {
					callback(result)
				}
			})
		},
		cleanCatch() {
			VueData().userBean.editableTabs = [];
			VueData().userBean.activeWindow.TableBean = getInitShowTableData();
			VueData().userBean.activeWindow.type = 0
			VueData().userBean.leftMenuBean.myGroups = []
			VueAction.loadGroup()
		},
		login(name, pwd, callback) {
			let DbHelper = $.MdManager.newHelper($.Encryption.CloudTable.UserMaster);
			if (name.contain('@')) {
				DbHelper.equalTo('mail', name)
			} else {
				DbHelper.equalTo('name', name)
			}
			DbHelper.equalTo('pwd', pwd)
			DbHelper.getData(function (arg) {

				callback(arg.length > 0, arg[0])
			})
		},
		getGroupNameFromArr(arr, gId) {
			let obj = {};
			obj = arr.find((item) => {
				return item.groupId === gId;
			});
			if (!obj)
				return '未知分组'
			return obj.groupName;
		},
		GetUserName(arr, gId) {
			let obj = {};
			obj = arr.find((item) => {
				return item.objectId === gId;
			});
			if (!obj)
				return '未知'
			return obj.name;
		},
		sendMail(str, to) {
			Email.send({
				Host: "smtp.qq.com",
				Username: "1091425078@qq.com",
				Password: "zhu.1992229",
				To: to,
				From: "1091425078@qq.com",
				Subject: "审核通过",
				Body: str

			}).then(
				message => {
					VueUI.$notify({
						title: '提示',
						message: message,
						type: 'success'
					});
				}
			);
		},
		JsWithVue: function (fun) {
			setTimeout(fun, "10");
		},
		getTransTimeStringArr: function (array) {
			var resArry = array.map(function (item, index, array) {
				item.isSet = false
				item.timeString = VueAction.getTime(item.createdAt)
				return item;
			})
			return resArry;
		},
		getTime: function (time) {
			return new Date(time).Format("yyyy-MM-dd HH:mm");
		},
		addTab: function (name, fun, key, mData) {
			let newTabName = ++(VueData().userBean.tabIndex) + '';
			VueData().userBean.editableTabs.push({
				id: key,
				title: name,
				name: newTabName,
				fun: fun,
				tableData: mData,

			});
			VueData().userBean.editableTabsValue = newTabName;
			return VueData().userBean.editableTabs.lastItem();
		},
		showUpload() {
			VueData().Form.upLoadForm.dialogVisible = true;
			VueData().Form.upLoadForm.isCustomer = false;
			VueData().Form.upLoadForm.bean = $.Encryption.MdData.bean

			VueData().Form.upLoadForm.disabled = !($.Encryption.power.AllowPostMd());
			console.log($.Encryption.MdData.bean)
		},
		showCustomerUpload() {
			VueData().Form.upLoadForm.dialogVisible = true;
			VueData().Form.upLoadForm.isCustomer = true;
			VueData().Form.upLoadForm.bean = $.Encryption.MdData.bean

			VueData().Form.upLoadForm.disabled = !($.Encryption.power.AllowPostMd());
			console.log($.Encryption.MdData.bean)
		},
		showSuperUser: function () {
			VueData().userBean.dialogVisible = true;
			VueAction.loadGroup();
			VueData().userBean.isMaster = $.Encryption.user.isMaster();
			VueData().userBean.powerList = $.Encryption.power
			// if (VueData().userBean.isMaster) {
			// 	VueData().userBean.activeWindow.disabledWrite = false;
			// }
		},
		isTablEditor: function (arry) { //判断当前表是否在编辑状态
			for (let i = 0; i < arry.length; i++) {
				if (arry[i].isSet) {
					return true;
				}
			}
			return false
		},
		hide: function () {
			VueData().customerBean.dialogVisible = true;
		},
		loadGroup: function (flag) {
			if ($.Encryption.user.bean.name == null) {
				return
			}

			$.MdManager.newHelper($.Encryption.CloudTable.groupNumber).equalTo('numberName', $.Encryption.user.bean.name).getData(
				function (list) {
					VueData().userBean.leftMenuBean.myGroups = list;
					$.Encryption.user.groups = list;
					VueData().userBean.allGroups = list.clone();
					VueData().userBean.allGroups.push($.Encryption.CloudTable.MainCode.customer);
				})
		},
		showCustomerCloud: function () {
			VueData().customerBean.dialogVisible = true;
		},
		loadedList: function (arry) {
			if (VueData().customerBean.dialogVisible) {
				VueData().customerBean.openListData = arry;
			} else if (VueData().userBean.dialogVisible) {
				VueData().userBean.activeWindow.TableBean.list = arry;
			}
			VueData().dialogloading = false;
		}
	}
	function showLoading(msg) {
		let loading = VueUI.$loading({
			lock: true,
			text: msg,
			spinner: 'el-icon-loading',
			background: 'rgba(0, 0, 0, 0.5)'
		});
		return loading

	}
	function registerSuperUser(loading) {
		$.MdManager.newSaveHelper($.Encryption.CloudTable.UserMaster)
			.setObj({
				name: VueData().Form.loginForm.registerBean.name,
				mail: VueData().Form.loginForm.registerBean.mail
			}).save(function (result) {
				loading.close();
				VueUI.$notify({
					title: '提示',
					message: '注册成功',
					type: 'success'
				});
			})
	}
</script>
<style>
	.space {
		height: 10px;
	}

	.el-header {
		background-color: #B3C0D1;
		color: white;
		line-height: 60px;
	}

	#loginTag {
		cursor: pointer;
		color: white;
		font-size: 20px;
		font-weight: 700;
	}

	.flex {
		display: flex;
		flex-direction: row-reverse;
		width: 100%;

		margin-bottom: 5px;
	}

	#loginTag:hover {
		color: #409EFF;
	}

	.el-aside {
		color: #333;
	}

	.el-slider__bar {
		height: 30px;
		border-radius: 15px;
	}

	.el-slider__runway {
		height: 30px;
		border-radius: 15px;
	}

	.el-slider__button {
		height: 30px;
		width: 30px;
		margin-top: 13px;
	}

	.el-tag+.el-tag {
		margin-left: 5px;

	}

	.el-tag {
		cursor: pointer;
	}

	.button-new-tag {
		padding: 5px 15px;

	}

	.input-new-tag {
		width: 90px;
		margin-left: 5px;
		vertical-align: bottom;
	}

	.cell {
		font-size: 15px;

	}

	.el-table__empty-block {
		height: 60px;

	}

	.el-image__inner {
		height: auto;
	}
</style>

</html>